<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>上传</title>
    <script src="/layui/layui.js"></script>
    <link rel="stylesheet" href="/layui/css/layui.css">
</head>
<body>

    <button type="button" class="layui-btn" id="test1" style="margin-top: 80px;margin-left: 150px">
        <i class="layui-icon">&#xe67c;</i>上传文件
    </button>

<script>
    layui.use(['upload'], function(){
        var upload = layui.upload;

        upload.render({
            elem: '#test1',
            url: '/ExcelJsUser/importJsUser',
            field: 'fil',
            accept: 'file',
            exts: 'xlsx|xls',
            done: function(res, index, upload){
                if(res == 200){
                    var layer = parent.layer;
                    layer.close(layer.index);

                }else if(res == 2){
                    var layer = layui.layer;
                    layer.msg('导入的账号不可重复');
                }
            }
        })
    });
</script>
</body>
</html>